package example.tinymce.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.RootPanel;
import gwtlx.tinymce.client.TinyMceConfig;
import gwtlx.tinymce.client.TinyMceEditor;
import gwtlx.tinymce.client.TinyMceTextArea;
import gwtlx.util.client.Utils;

/**
 * todo: javadoc
 * <p/>
 * &copy; Copyright by Konstantin Pavlov
 *
 * @author Konstantin Pavlov 
 * @version $LastChangedRevision$
 * @since 08.06.2010
 */
public class TinyMce implements EntryPoint {
    @Override
    public void onModuleLoad() {
        final TinyMceConfig config = TinyMceConfig.newInstance();
        config.setMode(TinyMceConfig.Mode.none);
        config.setTheme("advanced");

        Window.alert(Utils.toJSON(config));

        final TinyMceTextArea textArea = new TinyMceTextArea();
        textArea.setName("myTextArea");
        final RootPanel panel = RootPanel.get();
        panel.add(textArea);
        
        TinyMceEditor.init(config, "myTextArea");
    }
}
